/* author : ThomasV */
function dict_entry_callback(res) {
var res2 = eval("0,"+res);
var txt = res2.parse.text['*'];
var item = document.getElementById("dict_entry");
if(item) { item.innerHTML = txt;
self.pagenum_ml = get_elements_by_classname( 'pagenum', 'span' );
for(var i=self.pagenum_ml.length-1; i>=0; i--) {
var a = self.pagenum_ml[i];
var num = decodeURI( a.id ); //.replace(/\./g,'%')
if(num==".CE.9E") num="Ξ";
var page = a.title;
pagetitle = decodeURI( page ); //.replace('?','%3F').replace(/\.2/g,'%2').replace("%2F","/")
pagekey = pagetitle.replace(/ /g,"_");
var page_url = wgArticlePath.replace("$1", pagekey );
var ll = a.parentNode.nextSibling;
if(ll && ll.tagName=="A" && ll.className=="new") class_str=" class=\"new\" "; else class_str="";
var link_str = ""+num+""
a.innerHTML = " ["+link_str+"] ";
}
}
}
function show_dict_entry(index,from,to,title) {
var item = document.getElementById("dict_entry");
if(!item) return;
item.innerHTML="…";
var fs="fromsection=\""+title+"\"";
var ts="tosection=\""+title+"\"";
var url = wgServer+wgScriptPath+'/api.php?format=json&action=parse&text= ';
var api=sajax_init_object();
api.open("GET",url,true);
api.onreadystatechange=function(){ /*if(api.readyState!=4)return; if(api.status==200)*/ dict_entry_callback(api.responseText);};
api.send(null);
location.href = document.URL.split('#')[0] + '#'+ escape(encodeURI( title.replace(/ /g,'_')).replace(/%/g,'.') ).replace(/%/g,'.');
}
function dl_links() {
var mlist = document.getElementById("dynamic_links");
if(!mlist) return;
var index = mlist.title;
var url_title = document.URL.split('#')[1];
var elements = mlist.getElementsByTagName("a");
for(var i=0; i